import React from 'react'
import { Panel, PanelHeader, PanelBody, PanelFooter } from 'react-weui'
import List from './SortList'
import { connectSort } from '../../container/sort/connectSort'

 class SortBox extends React.Component {
	constructor(props) {
		super(props)
    }
    componentDidMount() {
    	this.props.sortActions.fetchSort(this.props.params.storeId);
    }

	render() {
		const { sortsData, sortsFetched } = this.props.sort;
		return (
			<Panel style={{ marginTop: '60px'}}>
				<PanelHeader>所有商品分类</PanelHeader>
				<PanelBody>
					<List storeId={this.props.params.storeId} sortsData={sortsData} />
				</PanelBody>
				<PanelFooter></PanelFooter>
			</Panel>
		);
	}
}

export default connectSort(SortBox)